package ch8.zadanie;

import java.util.Date;

public class Person {
	// static Integer count;
	String name;
	String surname;
	Date data;
	Car car;
	Date today = new Date();
	Long seconds;
	Long secondsCar;
	Long yearsCar;
	Long years;
	Person(String name, String surname, Date data, String marka, Date datka) {
		this.name = name;
		this.surname = surname;
		this.data = data;
		this.car.marka = marka;
		this.car.data = datka;
		seconds = today.getTime() - data.getTime();
		years = (seconds / (1000 * 60 * 60 * 24)) / 365;
		secondsCar = today.getTime() - car.data.getTime();
		yearsCar = (secondsCar / (1000 * 60 * 60 * 24)) / 365;
	}
	public String introduceYou() {
		return "My name is " + name + " " + surname + " and I have " + years
				+ " yers old and My " + car.marka + " has " + yearsCar
				+ " year old.";
	}
}
